package automatyzacjaPageObject;

import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;

public class LoginPage extends Page {

	public LoginPage(WebDriver driver) {
		super(driver); 
	}

	public void open() {
		open("http://demo.bananascrum.com/login");
	}
	
	public SprintPage correctLogIn() {
		driver.findElement(By.name("login")).sendKeys("admin");
		driver.findElement(By.name("password")).sendKeys("password");
		driver.findElement(By.name("commit")).click();
		return new SprintPage(driver);
	}

	public SprintPage tryLogin(String userName, String passwd) {
		driver.findElement(By.name("login")).sendKeys(userName);
		driver.findElement(By.name("password")).sendKeys(passwd);
		driver.findElement(By.name("commit")).click();
		return new SprintPage(driver);
	}}
